home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / coding / 80x86 / code32.lzh / PUTNUMTM.RT < prev    next >
Text File  |  1993-01-09  |  805b  |  38 lines

  1. public  _putnumtomem
  2. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  3. ; Put a hex number to mem
  4. ; In:
  5. ;   EAX - number
  6. ;   CL - number of characters - 1
  7. ;   EDX -> mem loc to put
  8. ; Out:
  9. ;   None
  10. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  11. _putnumtomem:
  12.         push ebx
  13.         push ecx
  14.         push edx
  15.         push edi
  16.         mov edi,edx
  17.         mov ebx,offset _hextbl
  18.         movzx edx,cl
  19.         xor cl,7
  20.         shl cl,2
  21.         rol eax,cl
  22.         mov ecx,edx
  23.         inc ecx
  24.         mov edx,eax
  25. putnumtomemml:
  26.         rol edx,4
  27.         mov al,dl
  28.         and al,0fh
  29.         xlat
  30.         stosb
  31.         loop putnumtomemml
  32.         pop edi
  33.         pop edx
  34.         pop ecx
  35.         pop ebx
  36.         ret
  37.  
  38.